#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>


int main()
{
    printf("I am a process, my pid is : %d , ppid is : %d\n",getpid(),getppid());
    pid_t pid = fork();
    if(pid == 0)
    {
        while(1)
        {
            printf("I am process_child, my pid is:%d, ppid is:%d\n",getpid(),getppid());
            sleep(5);
        }
        
    }
    else if(pid > 0)
    {
        while(1)
        {

            printf("I am process_father, my pid is:%d, ppid is:%d\n",getpid(),getppid());
            sleep(5);
        }

    }
    else
    {
        printf("Error");
    }
        
    return 0;

}








